﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Microsoft.ResourceManagement.Samples.ResourceManagementClient.WSEnumerate
{
[Serializable, XmlRoot(Namespace="http://schemas.microsoft.com/2006/11/ResourceManagement", IsNullable=false), XmlType(Namespace="http://schemas.microsoft.com/2006/11/ResourceManagement")]
public class SortingAttribute
{
    // Fields
    private bool ascending;
    private string attributeName;

    // Methods
    public SortingAttribute()
    {
    }

    public SortingAttribute(string attributeName) : this(attributeName, true)
    {
    }

    public SortingAttribute(string attributeName, bool ascending)
    {
        this.attributeName = attributeName;
        this.ascending = ascending;
    }

    // Properties
    [XmlAttribute]
    public bool Ascending
    {
        get
        {
            return this.ascending;
        }
        set
        {
            this.ascending = value;
        }
    }

    [XmlText]
    public string AttributeName
    {
        get
        {
            return this.attributeName;
        }
        set
        {
            this.attributeName = value;
        }
    }
}
}
